//
//  UIImage+Resize.h
//  SQB
//
//  Created by  tom on 10-1-11.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface UIImage (SQBUIImageResize)

// Returns an image resized to |targetSize|.
//
// If |preserveAspectRatio| is YES, the original image aspect ratio is
// preserved.
//
// When |preserveAspectRatio| is YES and if |targetSize|'s aspect ratio
// is different from the image, the resulting image will be shrunken to
// a size that is within |targetSize|.
//
// To preserve the |targetSize| when |preserveAspectRatio| is YES, set
// |trimToFit| to YES. The resulting image will be the largest proportion
// of the receiver that fits in the targetSize, aligned to center of the image.
//
// Image interpolation level for resizing is set to kCGInterpolationDefault.
- (UIImage *)sqb_imageByResizingToSize:(CGSize)targetSize
                   preserveAspectRatio:(BOOL)preserveAspectRatio
                             trimToFit:(BOOL)trimToFit;
- (UIImage *)sqb_imageByResizingToSize:(CGSize)targetSize
                            faceCenter:(CGPoint)faceCenter;
- (UIImage *)circleImage;
- (UIImage *)rotaImage;

// add by herui
- (UIImage *)imageByScalingToMaxSize;



@end